//
//  HomeCell.swift
//  app路由
//
//  Created by zhaoguoteng on 2020/4/29.
//  Copyright © 2020 zhaoguoteng. All rights reserved.
//

import UIKit

class HomeCell: UITableViewCell {
    
    @IBOutlet var nameLabel: UILabel!
    @IBOutlet var urlLabel: UILabel!
    @IBOutlet var remarkLabel: UILabel!
    @IBOutlet var urlImageView: UIImageView!
    @IBOutlet var iconImageView: UIImageView!

    var route: Route? {
        didSet {
            if let route = route {
                nameLabel.text = route.name
                urlLabel.text = route.url
                remarkLabel.text = route.remark

                urlImageView.isHidden = route.url?.count ?? 0 <= 0
                iconImageView.isHidden = route.img == nil
            }
        }
    }

    override func awakeFromNib() {
        
        urlImageView.isHidden = true
        iconImageView.isHidden = true
    }
    
}
